package com.urban.pooling.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * DTO for route.
 * 
 */
public class RouteDto implements Serializable {
	private static final long serialVersionUID = 1L;

	private Integer routeId;
	private String car;
	/** Should contain the number of available seats */
	private Integer seats;

	private String startAddress;
	private String destinationAddress;

	private Date startDateTime;
	private Date arrivalDateTime;

	private GeoPointDto startLocation;
	private GeoPointDto destinationLocation;

	private Integer driverId;

	private List<GeoPointDto> waypoints;

	private Boolean everyWorkDay;

	public RouteDto() {
	}

	public Integer getRouteId() {
		return routeId;
	}

	public void setRouteId(Integer routeId) {
		this.routeId = routeId;
	}

	public Date getArrivalDateTime() {
		return arrivalDateTime;
	}

	public void setArrivalDateTime(Date arrivalTime) {
		this.arrivalDateTime = arrivalTime;
	}

	public String getCar() {
		return car;
	}

	public void setCar(String car) {
		this.car = car;
	}

	public String getDestinationAddress() {
		return destinationAddress;
	}

	public void setDestinationAddress(String destLabel) {
		this.destinationAddress = destLabel;
	}

	public Integer getSeats() {
		return seats;
	}

	public void setSeats(Integer seats) {
		this.seats = seats;
	}

	public String getStartAddress() {
		return startAddress;
	}

	public void setStartAddress(String startLabel) {
		this.startAddress = startLabel;
	}

	public Date getStartDateTime() {
		return startDateTime;
	}

	public void setStartDateTime(Date startTime) {
		this.startDateTime = startTime;
	}

	public void setStartLocation(GeoPointDto startLocation) {
		this.startLocation = startLocation;
	}

	public void setDestinationLocation(GeoPointDto destinationLocation) {
		this.destinationLocation = destinationLocation;
	}

	public GeoPointDto getStarLocation() {
		return startLocation;
	}

	public GeoPointDto getDestinationLocation() {
		return destinationLocation;
	}

	public Integer getDriverId() {
		return driverId;
	}

	public void setDriverId(Integer driverId) {
		this.driverId = driverId;
	}

	public List<GeoPointDto> getWaypoints() {
		return waypoints;
	}

	public void setWaypoints(List<GeoPointDto> waypoints) {
		this.waypoints = waypoints;
	}

	public Boolean getEveryWorkDay() {
		return everyWorkDay;
	}

	public void setEveryWorkDay(Boolean everyWorkDay) {
		this.everyWorkDay = everyWorkDay;
	}

	public static class RouteDtoBuilder {
		private Integer routeId;
		private String car;
		private Integer seats;
		private String startAddress;
		private String destinationAddress;
		private Date startDateTime;
		private Date arrivalDateTime;
		private GeoPointDto startLocation;
		private GeoPointDto destinationLocation;
		private Integer driverId;
		private List<GeoPointDto> waypoints;
		private Boolean everyWorkDay;

		public RouteDtoBuilder routeId(Integer routeId) {
			this.routeId = routeId;
			return this;
		}

		public RouteDtoBuilder car(String car) {
			this.car = car;
			return this;
		}

		public RouteDtoBuilder seats(Integer seats) {
			this.seats = seats;
			return this;
		}

		public RouteDtoBuilder startAddress(String startAddress) {
			this.startAddress = startAddress;
			return this;
		}

		public RouteDtoBuilder destinationAddress(String destinationAddress) {
			this.destinationAddress = destinationAddress;
			return this;
		}

		public RouteDtoBuilder startDateTime(Date startDateTime) {
			this.startDateTime = startDateTime;
			return this;
		}

		public RouteDtoBuilder arrivalDateTime(Date arrivalDateTime) {
			this.arrivalDateTime = arrivalDateTime;
			return this;
		}

		public RouteDtoBuilder startLocation(GeoPointDto startLocation) {
			this.startLocation = startLocation;
			return this;
		}

		public RouteDtoBuilder destinationLocation(GeoPointDto destinationLocation) {
			this.destinationLocation = destinationLocation;
			return this;
		}

		public RouteDtoBuilder driverId(Integer driverId) {
			this.driverId = driverId;
			return this;
		}

		public RouteDtoBuilder waypoints(List<GeoPointDto> waypoints) {
			this.waypoints = waypoints;
			return this;
		}

		public RouteDtoBuilder everyWorkDay(Boolean everyWorkDay) {
			this.everyWorkDay = everyWorkDay;
			return this;
		}

		public RouteDto build() {
			return new RouteDto(this);
		}
	}

	private RouteDto(RouteDtoBuilder builder) {
		this.routeId = builder.routeId;
		this.car = builder.car;
		this.seats = builder.seats;
		this.startAddress = builder.startAddress;
		this.destinationAddress = builder.destinationAddress;
		this.startDateTime = builder.startDateTime;
		this.arrivalDateTime = builder.arrivalDateTime;
		this.startLocation = builder.startLocation;
		this.destinationLocation = builder.destinationLocation;
		this.driverId = builder.driverId;
		this.waypoints = builder.waypoints;
		this.everyWorkDay = builder.everyWorkDay;
	}

}